package day06;

import java.util.Random;
import java.util.Scanner;

public class Guessing {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        int n = r.nextInt(1000) + 1;
        //System.out.println(n);
        int max = 1000;
        int min = 1;

        while (true) {
            System.out.println("猜吧");
            int g = sc.nextInt();
            if (g > n) {
                max = g;
                System.out.println("猜大了" + min + "~" + max);
            } else if (g < n) {
                min = g;
                System.out.println("猜小了" + min + "~" + max);
            } else {
                System.out.println("猜对了");
                break;
            }

        }

    }


}
